package com.qixin.modules.dataauth.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.qixin.modules.dataauth.entity.SysDataAuth;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @Description: 数据权限配置表
 * @Author: qixin-boot
 * @Date:   2021-08-18
 * @Version: V1.0
 */
public interface SysDataAuthMapper extends BaseMapper<SysDataAuth> {

   /**
    * 设置用户数据权限
    * @param dataAuthId
    * @param userIdList
    */
   void setUserRelTenantIds(@Param("dataAuthId") String dataAuthId,@Param("userIdList") List<String> userIdList);

   /**
    * 删除用户数据权限
    * @param userIdList
    */
   void removeUserRelTenantIds(@Param("dataAuthId") String dataAuthId,@Param("userIdList") List<String> userIdList);

   /**
    * 查询数据权限用户
    *
    * @param page
    * @param dataAuthId
    * @return
    */
   IPage<Map<String, String>> queryUserList(Page page, @Param("dataAuthId") String dataAuthId, @Param("userName") String userName);

   /**
   * @Description: 根据数据权限id查询用户数量
   * @author: zzx
   * @date: 2021/8/25 11:41
   * @param id:
   * @Return: java.lang.Integer
   */
    Integer countSyuser(@Param("id")String id);
}
